// Chrome 扩展全局类型定义
import { CSSProperties, ReactNode } from 'react';

export interface ExtensionMessage {
  type: string;
  payload?: any;
}

export interface StorageData {
  settings: ExtensionSettings;
  [key: string]: any;
}

export interface ExtensionSettings {
  theme: 'light' | 'dark';
  language: 'zh-CN' | 'en-US';
  autoUpdate: boolean;
  enableNotifications: boolean;
}

export interface FloatBoxConfig {
  position: {
    x: number;
    y: number;
  };
  size: {
    width: number;
    height: number;
  };
  visible: boolean;
  pinned: boolean;
}

export interface TabInfo {
  id: number;
  url: string;
  title: string;
  active: boolean;
}

// 消息类型枚举
export enum MessageType {
  GET_SETTINGS = 'GET_SETTINGS',
  UPDATE_SETTINGS = 'UPDATE_SETTINGS',
  TOGGLE_FLOAT_BOX = 'TOGGLE_FLOAT_BOX',
  GET_TAB_INFO = 'GET_TAB_INFO',
  OPEN_SIDE_PANEL = 'OPEN_SIDE_PANEL'
}

// 组件 Props 类型
export interface ComponentProps {
  className?: string;
  style?: CSSProperties;
  children?: ReactNode;
}